/*
 * Selling Partner API for Easy Ship
 * Use the Selling Partner API for Easy Ship to build applications for sellers to manage and ship Amazon Easy Ship orders. With this API, you can get available time slots, schedule and reschedule Easy Ship orders, and print shipping labels, invoices, and warranties. To review the differences in Easy Ship operations by marketplace, refer to [Marketplace support](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support).
 *
 * OpenAPI spec version: 2022-03-23
 *
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */

package software.amazon.spapi.models.easyship.v2022_03_23;

import com.google.gson.annotations.SerializedName;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * The response schema for the bulk scheduling API. It returns by the bulk scheduling API containing an array of the
 * scheduled packtages, an optional list of orders we couldn&#x27;t schedule with the reason, and a pre-signed URL for a
 * ZIP file containing the associated shipping labels plus the documents enabled for your marketplace.
 */
@Schema(
        description =
                "The response schema for the bulk scheduling API. It returns by the bulk scheduling API containing an array of the scheduled packtages, an optional list of orders we couldn't schedule with the reason, and a pre-signed URL for a ZIP file containing the associated shipping labels plus the documents enabled for your marketplace.")
public class CreateScheduledPackagesResponse {
    @SerializedName("scheduledPackages")
    private List<ModelPackage> scheduledPackages = null;

    @SerializedName("rejectedOrders")
    private List<RejectedOrder> rejectedOrders = null;

    @SerializedName("printableDocumentsUrl")
    private String printableDocumentsUrl = null;

    public CreateScheduledPackagesResponse scheduledPackages(List<ModelPackage> scheduledPackages) {
        this.scheduledPackages = scheduledPackages;
        return this;
    }

    public CreateScheduledPackagesResponse addScheduledPackagesItem(ModelPackage scheduledPackagesItem) {
        if (this.scheduledPackages == null) {
            this.scheduledPackages = new ArrayList<ModelPackage>();
        }
        this.scheduledPackages.add(scheduledPackagesItem);
        return this;
    }

    /**
     * A list of packages. Refer to the &#x60;Package&#x60; object.
     *
     * @return scheduledPackages
     */
    @Schema(description = "A list of packages. Refer to the `Package` object.")
    public List<ModelPackage> getScheduledPackages() {
        return scheduledPackages;
    }

    public void setScheduledPackages(List<ModelPackage> scheduledPackages) {
        this.scheduledPackages = scheduledPackages;
    }

    public CreateScheduledPackagesResponse rejectedOrders(List<RejectedOrder> rejectedOrders) {
        this.rejectedOrders = rejectedOrders;
        return this;
    }

    public CreateScheduledPackagesResponse addRejectedOrdersItem(RejectedOrder rejectedOrdersItem) {
        if (this.rejectedOrders == null) {
            this.rejectedOrders = new ArrayList<RejectedOrder>();
        }
        this.rejectedOrders.add(rejectedOrdersItem);
        return this;
    }

    /**
     * A list of orders we couldn&#x27;t scheduled on your behalf. Each element contains the reason and details on the
     * error.
     *
     * @return rejectedOrders
     */
    @Schema(
            description =
                    "A list of orders we couldn't scheduled on your behalf. Each element contains the reason and details on the error.")
    public List<RejectedOrder> getRejectedOrders() {
        return rejectedOrders;
    }

    public void setRejectedOrders(List<RejectedOrder> rejectedOrders) {
        this.rejectedOrders = rejectedOrders;
    }

    public CreateScheduledPackagesResponse printableDocumentsUrl(String printableDocumentsUrl) {
        this.printableDocumentsUrl = printableDocumentsUrl;
        return this;
    }

    /**
     * Get printableDocumentsUrl
     *
     * @return printableDocumentsUrl
     */
    @Schema(description = "")
    public String getPrintableDocumentsUrl() {
        return printableDocumentsUrl;
    }

    public void setPrintableDocumentsUrl(String printableDocumentsUrl) {
        this.printableDocumentsUrl = printableDocumentsUrl;
    }

    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        CreateScheduledPackagesResponse createScheduledPackagesResponse = (CreateScheduledPackagesResponse) o;
        return Objects.equals(this.scheduledPackages, createScheduledPackagesResponse.scheduledPackages)
                && Objects.equals(this.rejectedOrders, createScheduledPackagesResponse.rejectedOrders)
                && Objects.equals(this.printableDocumentsUrl, createScheduledPackagesResponse.printableDocumentsUrl);
    }

    @Override
    public int hashCode() {
        return Objects.hash(scheduledPackages, rejectedOrders, printableDocumentsUrl);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class CreateScheduledPackagesResponse {\n");

        sb.append("    scheduledPackages: ")
                .append(toIndentedString(scheduledPackages))
                .append("\n");
        sb.append("    rejectedOrders: ")
                .append(toIndentedString(rejectedOrders))
                .append("\n");
        sb.append("    printableDocumentsUrl: ")
                .append(toIndentedString(printableDocumentsUrl))
                .append("\n");
        sb.append("}");
        return sb.toString();
    }

    /** Convert the given object to string with each line indented by 4 spaces (except the first line). */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }
}
